<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>管理员-添加院校</title>
    <link rel="stylesheet" href="./layui2_9/css/layui.css">
</head>
<body>
<!-- 内容主体区域-->
<div class="layui-container">
    <div class="layui-row">
        <div class="layui-col-md12">
            <span class="layui-badge-dot"></span> <span
                class="layui-badge-dot layui-bg-orange"></span> <span
                class="layui-badge-dot layui-bg-green"></span> <span
                class="layui-badge-dot layui-bg-cyan"></span> <span
                class="layui-badge-dot layui-bg-blue"></span> <span
                class="layui-badge-dot layui-bg-black"></span> <span
                class="layui-badge-dot layui-bg-gray"></span>
            <fieldset class="layui-elem-field layui-field-title"
                      style="margin-top: 30px;">
                <legend>添加院校</legend>
            </fieldset>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-col-md12">
            <fieldset class="layui-elem-field">
                <legend>信息</legend>
                <div class="layui-field-box">

                        <form id="formFilter" class="layui-form layui-form-pane" style="padding: 30px;" action="adminSchoolAdd.html" method="post">
                            <div class="layui-input-inline">
                                <label class="layui-form-label">学校</label>
                                <div class="layui-input-block" style="width: 150px;">
                                    <input name="" placeholder="输入选择" class="layui-input" id="ID-dropdown-demo-base-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <button class="layui-btn" lay-submit="saveform" lay-filter="saveform">保存</button>
                            </div>
                        </form>

                </div>
            </fieldset>

        </div>
    </div>
</div>
<script src="./layui2_9/layui.js"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function () {
        var element = layui.element;
        //监听导航点击
        element.on('nav(test)', function (elem) {
            //console.log(elem)
            layer.msg(elem.text());
        });
    });
</script>
<script>
    var form;
    layui.use(['form', 'layedit', 'laydate'], function () {
        var layer = layui.layer,
            laydate = layui.laydate;
        form = layui.form;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //自定义验证规则
        form.verify({
            name: function (value) {
                if (value.length < 1) {
                    return '名字至少得1个字符啊';
                }
            }
        });

        //监听提交
        form.on('submit(saveform)', function (data) {
            /*layer.alert(JSON.stringify(data.field), {
                title : '最终的提交信息'
            })*/
            //return false;

        });
    });
</script>
<script>
    layui.use(function(){
        var dropdown = layui.dropdown;
        // 绑定输入框
        dropdown.render({
            elem: '#ID-dropdown-demo-base-input',
            closeOnClick: false, // 不开启“打开与关闭的自动切换”，即点击输入框时始终为打开状态
            data: [{
                title: '中南大学',
                id: 101
            },{
                title: '湖南大学',
                id: 102
            },{
                title: '长沙大学',
                id: 103
            }],
            click: function(obj){
                this.elem.val(obj.title);
            },
            style: 'min-width: 235px;'
        })
    });
</script>
</body>
</html>
